package core

import "context"

type Node struct {
	Name     string //Node名
	Id       string //Node节点
	BindAddr string //绑定地址
}

type Registrar interface {
	Register(ctx context.Context, node *Node) error
	Deregister(ctx context.Context, node *Node) error
}

type Discovery interface {
	GetService(ctx context.Context, clusterName string) ([]*Node, error)
	Watch(ctx context.Context, clusterName string) (Watcher, error)
}

type Watcher interface {
	Next() ([]*Node, error)
	Stop() error
}
